<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:84:"F:\phpStudy\PHPTutorial\WWW\tp5\public/../application/admin\view\cate\cate-list.html";i:1539176249;}*/ ?>
<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>知之后台</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/static/admin/css/font.css">
    <link rel="stylesheet" href="/static/admin/css/xadmin.css">
    <script type="text/javascript" src="/static/admin/js/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="/static/admin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/admin/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <!--<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>-->
      <!--<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>-->
    <![endif]-->
  </head>
  
  <body class="layui-anim layui-anim-up">
    <div class="x-nav">
      <span class="layui-breadcrumb">

      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">

      </div>
      <xblock>

        <button class="layui-btn" onclick="x_admin_show('添加分类','cateadd',600,400)"><i class="layui-icon"></i>添加</button>
        <span class="x-right" style="line-height:40px">共有数据：<?php echo $total; ?> 条</span>
      </xblock>
      <table class="layui-table">
        <thead>
          <tr>
            <th>ID</th>
            <th>分类名</th>
            <th>状态</th>
            <th>操作</th></tr>
        </thead>
        <tbody>
          <?php if(is_array($clist) || $clist instanceof \think\Collection || $clist instanceof \think\Paginator): $i = 0; $__LIST__ = $clist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
          <tr>
            <td><?php echo $v['zz_cate_id']; ?></td>
            <td><?php echo $v['zz_cate_name']; ?></td>
            <td class="td-status">
              <?php if($v['zz_cate_status'] == 1): ?>
              <span class="layui-btn layui-btn-normal layui-btn-mini">已启用</span></td>
              <?php else: ?>
              <span class="layui-btn layui-btn-danger layui-btn-mini">已停用</span></td>
              <?php endif; ?>
            <td class="td-manage">
              <a onclick="memberStop(this,<?php echo $v['zz_cate_id']; ?>,<?php echo $v['zz_cate_status']; ?>)" href="javascript:;">

                <i class="layui-icon">&#xe601;</i>

              </a>
              <a title="编辑"  onclick="x_admin_show('编辑','cateedit/<?php echo $v['zz_cate_id']; ?>',600,400)" href="javascript:;">
                <i class="layui-icon">&#xe642;</i>
              </a>
            </td>
          </tr>
          <?php endforeach; endif; else: echo "" ;endif; ?>
        </tbody>
      </table>
      <div class="page">
        <?php echo $clist->render(); ?>
      </div>

    </div>
    <script>
      layui.use('laydate', function(){
          var laydate = layui.laydate;

          //执行一个laydate实例
          laydate.render({
            elem: '#start' //指定元素
          });

          //执行一个laydate实例
          laydate.render({
            elem: '#end' //指定元素
          });


      });

      /*分类-停用*/
      function memberStop(obj,id,status){
          $.ajax({
              url:'dodel',
              type:'get',
              data:{id : id,status : status},
              dataType:'json',
              success:function (data) {
                  if (data.status) {
                      layer.msg("更改成功", {offset:'50%',icon: 6,time:500}, function () {
                          window.location.reload();
                      });

                  }
              }
          });
      }



    </script>

  </body>

</html>